Skip to main content

Get Cryptocurrency Price

The getCryptoPrice query is used to retrieve the current price of a specified cryptocurrency.

Query: getCryptoPrice

Schema:

getCryptoPrice(
symbol: String!
): Float

Parameters

  • symbol (String): The symbol of the cryptocurrency to get the price for. This field is mandatory.

Return

The query returns a float representing the current price of the specified cryptocurrency.

Example Query

The following is an example of how to use the getCryptoPrice query to retrieve the price of a specified cryptocurrency:

query {
getCryptoPrice(
symbol: "BTC"
)
}

Return

The example returns the current price of the cryptocurrency with the symbol "BTC".

In this example, the query retrieves the current price of Bitcoin (BTC). The return value is a float representing the price of the specified cryptocurrency.